class Home:
	def __init__(self,new_area,new_kind,new_addr):
		self.area = new_area
		self.kind = new_kind
		self.addr = new_addr
		self.left_area = new_area
		self.contain_items = []

	def __str__(self):

		msg = '房子的面积是%d类型是%s地址是%s可用面积是%d'%(self.area,self.kind,self.addr,self.left_area)
		msg += '当前房子的总物品有%s'%(str(self.contain_items))
		return msg

	def add_item(self,item):
		# self.left_area -= item.area
		# self.contain_items.append(item.name)

		self.left_area -= item.get_area()
		self.contain_items.append(item.get_name())

class Bed:
	def __init__(self,new_name,new_area):
		self.name = new_name
		self.area = new_area

	def __str__(self):
		return '牌子是%s面积是%d'%(self.name,self.area)

	def get_area(self):
		return self.area

	def get_name(self):
		return self.name


vhome = Home(120,'三室二厅','西安')
print(vhome)


bed1 = Bed('小米',4)
print(bed1)

bed2 = Bed('小米',4)

vhome.add_item(bed1)
vhome.add_item(bed2)
print(vhome)